Communications 106

After the reader presses the button below, I'll write hello to the frame above.

Discussion

This sixth "hello" program uses document.open(), document.write(), and document.close() to reload a frame's contents. Open resets the frame so that you can start to load new information with your writes. When the writes complete, a close instructs the window to stop loading new information.

You must designate a particular frame or window to write to, when writing to other than the current frame. In this example, to write to the JSChello frame, it must be given an explicit path. For more details, please read about frames and windows.

Writing to a frame

parent.JSChello.document.open()
parent.JSChello.document.write(s1+msg+s2)
parent.JSChello.document.close()
Copyright ©1998 by Charles River Media, All Rights Reserved